#!/usr/bin/python3.8.9
# -*- coding: utf-8 -*-

# @Author  : Tina Yu
# @Time    : 2021-12-30 19:26

# 通讯录页面
from appium.webdriver.common.mobileby import MobileBy

from homework.task_app.base.base_page import BasePage
from homework.task_app.page.add_member_list_page import AddMemberListPage
from homework.task_app.page.member_search_page import MemberSearchPage


class AddressListPage(BasePage):

    def goto_add_member_list(self):
        """跳转到添加用户列表页"""
        # 滚动屏幕到底部，点击添加成员
        self.sroll_to_click("添加成员")
        return AddMemberListPage(self.driver)

    def goto_member_search(self):
        """跳转到成员搜索"""
        # 点击右上角搜索图标
        self.find_and_click(MobileBy.XPATH,
                            "//*[contains(@text,'团队')]/../../../..//*[@class='android.widget.RelativeLayout']")
        return MemberSearchPage(self.driver)
